#[derive(Debug)]
struct Age {
    age: i32,
}

impl From<i32> for Age {
    fn from(age: i32) -> Self {
        Age { age }
    }
}

fn main() {
    let age = Age::from(18);
    println!("the age {:?}", age);
    let age1: Age = 18i32.into(); //编译器自动实现了into方法，必须显示注明age1的类型
    println!("the age {:?}", age1);
}
